#include <stdlib.h>
#include <string.h>
#include "item.h"
#include "util.h"

struct item * new_item(	int 	id, 
			char 	*name,
			int	owner,
			int	pos,
			int	frame,
			int	amount,
			int	hardiness_max,
			int	hardiness,
			int	type,
			char	*shape			
			)
{
	struct item *item = (struct item*)malloc(sizeof(struct item));
	
	if (item == NULL)
	{
		return NULL;
	}

	item->id 	= id;
	item->name 	= new_string(name);
	item->owner	= owner;
	item->pos	= pos;
	item->frame	= frame;
	item->amount	= amount;
	item->hardiness_max	= hardiness_max;
	item->hardiness	= hardiness;
	item->type	= type;
	item->shape	= new_string(shape);

	return item;
}


